import React from 'react'
import styles from './index.less'

// const date = new Date()
// const year = date.getFullYear() // 获取完整的年份(4位)

const isMobile = /iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone/i.test(navigator.userAgent)

class loginAndRegister extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      infoMap: [
        {
          imageName: 'xuelang-hufu',
          title: '数据集成引擎',
          description: '工业数据资源管理与调度系统',
        },
      ],
      randomInfo: {},
    }
  }

  componentDidMount() {
    const randomInfo = this.getRandomInfo()
    this.setState({ randomInfo })
  }

  componentWillUnmount() { }

  getRandomInfo = () => {
    const { infoMap } = this.state
    return infoMap[0]
  };

  renderInfoContent = () => {
    const { randomInfo } = this.state
    const { logoPreviewUrl, caseNumber } = this.props
    return (
      <div className="content">
        {/* <img className="logo" src={logoPreviewUrl || logoImage} alt="logo" /> */}
        {/* <div>{ this.props.title || randomInfo.title}</div> */}
        {/* <div>{randomInfo.description}</div> */}
        {/* <div className="image xuelang-hufu" /> */}
        <div className="copyright">
          {!isMobile && caseNumber}
          {/* 'Copyright © {year} 雪浪云 All rights reserved 苏ICP备 18034176号-1' */}
        </div>
        <div className={styles.disabled} />
      </div>
    )
  };

  render() {
    return <div className="info">{this.renderInfoContent()}</div>
  }
}

export default loginAndRegister
